<template>
  <div class="elm-edit f_edit">
    <elm-page-bb class="ei_edit" v-loading="loading">

      <el-card shadow="hover" style="height: 180px;">
        <div slot="header">
          <span style="font-weight: bold;">节点信息</span>
          <!--<el-button type="danger" size="mini" style="float:right;margin-top: -4px;" @click="deleteNode">删除本节点</el-button>-->
        </div>
        <el-form ref="model" :model="model" size="small" label-width="120px">
          <elm-row>
            <el-form-item label="名称" prop="title" :rules="[{ required: true, message: '名称 必须填写'}]">
              <el-input v-model="model.title"></el-input>
            </el-form-item>
          </elm-row>
          <elm-row>
            <el-form-item label="节点策略" prop="node_policy" :rules="[{ required: true, message: '策略 必须选择'}]">
              <el-select v-model="model.node_policy" size="mini" style="width:120px;">
                <el-option
                    v-for="item in node_policy_list"
                    :key="item.name"
                    :label="item.name"
                    :value="item.name">
                </el-option>
              </el-select>
            </el-form-item>
          </elm-row>
          <elm-row>
            <el-form-item label="退回策略" prop="pb_policy" :rules="[{ required: true, message: '退回策略 必须选择'}]">
              <el-select v-model="model.pb_policy" size="mini" style="width:120px;">
                <el-option
                    v-for="item in node_pb_policy_list"
                    :key="item.name"
                    :label="item.name"
                    :value="item.name">
                </el-option>
              </el-select>
            </el-form-item>
          </elm-row>
        </el-form>
      </el-card>

      <el-card shadow="hover" style="height: 125px;">
        <div slot="header">
          <span style="font-weight: bold;">选择处理人</span>
          <span style="font-weight: bold;"></span>
          <elm-open-button url="flow_canvas_node_edit_person" :full="false" width="600" height="280" size="mini"
                           style="float:right;margin-top: -4px;"
                           :data="{'check_zjsj':node_check.check_zjsj,'check_flow_creater':node_check.check_flow_creater,'check_dynamic':node_check.check_dynamic}"
                           title="新增">新增</elm-open-button>
        </div>
        <el-row style="margin-top: -5px;">
          <el-tag v-for="item in node_check_data.check_org_show" :key="item.id" style="margin-left: 10px;margin-top: 5px;"
                  closable @close="deleteCheck('check_org',item.id)">
            {{item.name}}</el-tag>
          <el-tag v-for="item in node_check_data.check_role_show" :key="item.id" style="margin-left: 10px;;margin-top: 5px;"
                  closable @close="deleteCheck('check_role',item.id)">
            {{item.name}}</el-tag>
          <el-tag v-for="item in node_check_data.check_user_show" :key="item.id" style="margin-left: 10px;;margin-top: 5px;"
                  closable @close="deleteCheck('check_user',item.id)">
            {{item.name}}</el-tag>
          <el-tag v-if="node_check.check_zjsj" style="margin-left: 10px;;margin-top: 5px;"
                  closable @close="deleteCheck('check_zjsj')">
            直属领导</el-tag>
          <el-tag v-if="node_check.check_flow_creater" style="margin-left: 10px;;margin-top: 5px;"
                  closable @close="deleteCheck('check_flow_creater')">
            流程发起者</el-tag>
          <el-tag v-if="node_check.check_dynamic" style="margin-left: 10px;;margin-top: 5px;"
                  closable @close="deleteCheck('check_dynamic')">
            由上一节点指定</el-tag>
        </el-row>

        <el-form v-if="false" size="small" label-width="100px">
          <elm-row>
            <el-form-item label='部门：'>
              <elm-tag :items="node_check_data.check_org_show" style="margin-left: -3px;" width="200px">
                <template  #text="{ item }">
                  <span style="margin-right: 5px;">{{item.name}}</span>
                </template >
                <elm-org @changed="orgSelected" v-model="node_check_data.check_org_temp"></elm-org>
              </elm-tag>
            </el-form-item>
          </elm-row>
          <elm-row>
            <el-form-item label='角色：'>
              <elm-tag :items="node_check_data.check_role_show" style="margin-left: -3px;" width="200px">
                <template  #text="{ item }">
                  <span style="margin-right: 5px;">{{item.name}}</span>
                </template >
                <el-select v-model="node_check_data.check_role_temp" size="mini" style="width:100%;" @change="roleSelected">
                  <el-option
                      v-for="item in node_check_for_select.role_list"
                      :key="item.id"
                      :label="item.name"
                      :value="item.id">
                  </el-option>
                </el-select>
              </elm-tag>
            </el-form-item>
          </elm-row>
          <elm-row>
            <el-form-item label='用户：'>
              <elm-tag v-show="!node_check.check_user_n" :items="node_check_data.check_user_show" style="margin-left: -3px;" width="200px">
                <template  #text="{ item }">
                  <span style="margin-right: 5px;">{{item.name}}</span>
                </template >
                <elm-user @changed="userSelected" v-model="node_check_data.check_user_temp"></elm-user>
              </elm-tag>
            </el-form-item>
          </elm-row>
          <elm-row>
            <el-form-item label='直接上级：'>
              <el-switch v-model="node_check.check_zjsj" active-color="#13ce66" inactive-color="#DCDFE6"
                         active-text="上一节点提交者的直接上级"></el-switch>
            </el-form-item>
          </elm-row>
          <elm-row>
            <el-form-item label='流程发起者：'>
              <el-switch v-model="node_check.check_flow_creater" active-color="#13ce66" inactive-color="#DCDFE6"
                         active-text="发起流程并提交完成初始节点的用户"></el-switch>
            </el-form-item>
          </elm-row>
          <elm-row>
            <el-form-item label='由上一节点指定：'>
              <el-switch v-model="node_check.check_dynamic" active-color="#13ce66" inactive-color="#DCDFE6"
                         active-text="上一节点提交时指定的用户"></el-switch>
            </el-form-item>
          </elm-row>
        </el-form>
      </el-card>

      <el-card shadow="hover" style="height: 300px;">
        <div slot="header">
          <span style="font-weight: bold;">管理本节点的表单项</span>
        </div>
        <elm-table :data='ff_item_list' :stripe='true' :border='true' size='mini' :page-size="9999" style="max-height: 250px;">
          <el-table-column label="标题" min-width="100px" header-align="center">
            <template slot-scope="scope">
              {{scope.row.title}}
            </template>
          </el-table-column>
          <el-table-column label="在本节点" width="160px" fixed="right" align="center">
            <template slot-scope="scope">
              <el-switch v-model="scope.row.ee_show" active-color="#13ce66" inactive-color="#ff4949"
                         active-text="显示" inactive-text="不显示"></el-switch>
            </template>
          </el-table-column>
          <el-table-column label="在本节点" width="180px" fixed="right" align="center">
            <template slot-scope="scope">
              <el-switch v-show="scope.row.ee_show" active-color="#13ce66" inactive-color="#ff4949"
                         v-model="scope.row.ee_edit" active-text="填写" inactive-text="仅显示"></el-switch>
            </template>
          </el-table-column>
        </elm-table>
      </el-card>


      <template #bottom>
        <el-button type="success" size="small" @click="submit">保存</el-button>
        <el-button size="small" @click="close">取消</el-button>
      </template>
    </elm-page-bb>
  </div>
</template>

<script>
export default {
  extends: elmVueBase,
  data() {
    return {
      loading:true,

      DE_INFO: null,

      flow_id: '',
      model: {},

      node_policy_list:[{'name':'抢签'},{'name':'会签'},],
      node_pb_policy_list:[{'name':'退首顺回'},{'name':'退首跳回'},{'name':'顺退顺回'},{'name':'顺退跳回'},{'name':'不可退回'},],

      node_check:{
        check_org:false,
        check_role:false,
        check_user:false,
        check_user_n:false,
        check_zjsj:false,
        check_flow_creater:false,
        check_dynamic:false,
      },
      node_check_for_select:{
        user_list:[],
        role_list:[],
        org_list:[],
      },
      node_check_data:{
        check_org:[],
        check_org_show:[],
        check_org_temp:null,

        check_role:[],
        check_role_show:[],
        check_role_temp:null,

        check_user:[],
        check_user_show:[],
        check_user_temp:null,
      },
      fInterfaceData:{
        'inter_org':{'id':'inter_0010','param_id':'01',},
        'inter_role':{'id':'inter_0020','param_id':'02',},
        'inter_user':{'id':'inter_0030','param_id':'03',},
        'inter_zjsj':{'id':'inter_0040','param_id':'04',},
        'inter_flow_creater':{'id':'inter_0050','param_id':'05',},
        'inter_dynamic':{'id':'inter_0060','param_id':'06',},
      },

      is_add:null,
      add_node_type:null,
      upper_node_id:null,

      ff_item_list:[],
    }
  },
  mounted() {
    this.DE_INFO = elm.dialog.request;

    this.flow_id = this.DE_INFO.flow_id;
    this.is_add = this.DE_INFO.is_add;
    this.add_node_type = this.DE_INFO.add_node_type;
    this.upper_node_id = this.DE_INFO.upper_node_id;

    let ff_item_list = [];
    let DE_ff_item_list = this.DE_INFO.ff_item_list;
    if(DE_ff_item_list!=null && DE_ff_item_list.length>0){
      for(let i=0;i<DE_ff_item_list.length;i++){
        let item = {
          'title':DE_ff_item_list[i].title,
          'column_name':DE_ff_item_list[i].column_name.replace('@',''),
          'ee_show':true,
          'ee_edit':true,
        };
        ff_item_list.push(item);
      }
    }
    if(!this.em(this.DE_INFO.model.ee_ff_item)){
      let ee_ff_item = JSON.parse(this.DE_INFO.model.ee_ff_item);
      for(let i=0;i<ee_ff_item.length;i++){
        for(let kk=0;kk<ff_item_list.length;kk++){
          let item = ff_item_list[kk];
          if(item.column_name == ee_ff_item[i].column_name){
            item.ee_show = ee_ff_item[i].ee_show;
            item.ee_edit = ee_ff_item[i].ee_edit;
          }
        }
      }
    }
    this.ff_item_list = ff_item_list;

    this.v_getData();
  },
  methods: {
    async v_getData(){
      this.loading = true;
      this.model = {
        'id':this.DE_INFO.model.id,
        'title':this.DE_INFO.model.title,
        'node_policy':this.DE_INFO.model.node_policy,
        'pb_policy':this.DE_INFO.model.pb_policy,
        'user_policy':this.DE_INFO.model.user_policy,
      };

      if(this.em(this.model['node_policy'])){ this.model['node_policy'] = this.node_policy_list[0].name; }
      if(this.em(this.model['pb_policy'])){ this.model['pb_policy'] = this.node_pb_policy_list[0].name; }

      this.getExtraData();
    },
    async getExtraData(){
      this.loading = true;

      this.node_check.check_org = false;
      this.node_check.check_role = false;
      this.node_check.check_user = false;
      this.node_check.check_zjsj = false;
      this.node_check.check_flow_creater = false;
      this.node_check.check_dynamic = false;
      this.node_check_data.check_org = [];
      this.node_check_data.check_org_show = [];
      this.node_check_data.check_role = [];
      this.node_check_data.check_role_show = [];
      this.node_check_data.check_user = [];
      this.node_check_data.check_user_show = [];

      let checkForSelectData = await elm.post('/system/flow/one_road_flow/GetDataForNodeCheckEdit', { });
      this.node_check_for_select.role_list = checkForSelectData.role_list;
      this.node_check_for_select.org_list = checkForSelectData.org_list;
      this.node_check_for_select.user_list = [];
      let nodeCheckData = this.DE_INFO.nodeCheckData;
      if(nodeCheckData.check_list.length>0){
        for(let i=0;i<nodeCheckData.check_list.length;i++){
          let nChceck = nodeCheckData.check_list[i];
          if(nChceck.iface_id==this.fInterfaceData.inter_org.id){
            this.node_check.check_org = true;
            let paramValues = [];
            for(let kk=0;kk<nodeCheckData.check_param_list.length;kk++){
              let nChceckParam = nodeCheckData.check_param_list[kk];
              if(nChceckParam.check_id == nChceck.id && nChceckParam.iface_param_id == this.fInterfaceData.inter_org.param_id){
                paramValues.push(nChceckParam.value);
              }
            }
            this.node_check_data.check_org = paramValues;
            for(let jj=0;jj<this.node_check_data.check_org.length;jj++){
              for(let kk=0;kk<this.node_check_for_select.org_list.length;kk++){
                if(this.node_check_data.check_org[jj]==this.node_check_for_select.org_list[kk].id){
                  this.node_check_data.check_org_show.push({'id':this.node_check_for_select.org_list[kk].id,'name':this.node_check_for_select.org_list[kk].org_name_path});
                }
              }
            }
          }
          else if(nChceck.iface_id==this.fInterfaceData.inter_role.id){
            this.node_check.check_role = true;
            let paramValues = [];
            for(let kk=0;kk<nodeCheckData.check_param_list.length;kk++){
              let nChceckParam = nodeCheckData.check_param_list[kk];
              if(nChceckParam.check_id == nChceck.id && nChceckParam.iface_param_id == this.fInterfaceData.inter_role.param_id){
                paramValues.push(nChceckParam.value);
              }
            }
            this.node_check_data.check_role = paramValues;
            for(let jj=0;jj<this.node_check_data.check_role.length;jj++){
              for(let kk=0;kk<this.node_check_for_select.role_list.length;kk++){
                if(this.node_check_data.check_role[jj]==this.node_check_for_select.role_list[kk].id){
                  this.node_check_data.check_role_show.push({'id':this.node_check_for_select.role_list[kk].id,'name':this.node_check_for_select.role_list[kk].name});
                }
              }
            }
          }
          else if(nChceck.iface_id==this.fInterfaceData.inter_user.id){
            if(false && nodeCheckData.check_param_list.length>0 && nodeCheckData.check_param_list[0].value=='nothing'){
              this.node_check.check_user_n = true;
            }
            else{
              this.node_check.check_user_n = false;
              if(nodeCheckData.check_param_list.length>0){
                this.node_check.check_user = true;
                let paramValues = [];
                for(let kk=0;kk<nodeCheckData.check_param_list.length;kk++){
                  let nChceckParam = nodeCheckData.check_param_list[kk];
                  if(nChceckParam.check_id == nChceck.id && nChceckParam.iface_param_id == this.fInterfaceData.inter_user.param_id){
                    paramValues.push(nChceckParam.value);
                    this.node_check_data.check_user_show.push({'id':nChceckParam.value,'name':nChceckParam.uu_user_name});
                  }
                }
                this.node_check_data.check_user = paramValues;
              }
            }
          }
          else if(nChceck.iface_id==this.fInterfaceData.inter_zjsj.id){
            this.node_check.check_zjsj = true;
          }
          else if(nChceck.iface_id==this.fInterfaceData.inter_flow_creater.id){
            this.node_check.check_flow_creater = true;
          }
          else if(nChceck.iface_id==this.fInterfaceData.inter_dynamic.id){
            this.node_check.check_dynamic = true;
          }
        }
      }
      this.loading = false
    },

    async submit() {
      try{await this.$refs["model"].validate();}catch{console.log('表单验证未通过'); return;}

      this.loading = true;
      this.model['flow_id'] = this.flow_id;

      //组装参与者数据
      let node_check = [];
      let node_check_param = [];
      let person_name = '';
      let person_num = 0;
      if(this.em(this.model.user_policy)){this.model.user_policy='全部参与者';}
      if(this.model.user_policy=='全部参与者'){

        this.node_check_data.check_org = [];
        for(let i=0;i<this.node_check_data.check_org_show.length;i++){
          this.node_check_data.check_org.push(this.node_check_data.check_org_show[i].id);

          let nameList = this.node_check_data.check_org_show[i].name.split('/');
          person_name = person_name+'---'+nameList[nameList.length-1];
          person_num++;
        }
        this.node_check_data.check_role = [];
        for(let i=0;i<this.node_check_data.check_role_show.length;i++){
          this.node_check_data.check_role.push(this.node_check_data.check_role_show[i].id);

          person_name = person_name+'---'+this.node_check_data.check_role_show[i].name;
          person_num++;
        }
        this.node_check_data.check_user = [];
        for(let i=0;i<this.node_check_data.check_user_show.length;i++){
          this.node_check_data.check_user.push(this.node_check_data.check_user_show[i].id);

          person_name = person_name+'---'+this.node_check_data.check_user_show[i].name;
          person_num++;
        }

        this.node_check.check_org = this.node_check_data.check_org.length>0;
        this.node_check.check_role = this.node_check_data.check_role.length>0;
        this.node_check.check_user = this.node_check_data.check_user.length>0;
        if(this.node_check.check_user_n){this.node_check.check_user =false;}

        if(this.node_check.check_org){
          let cc = {
            'id': elm.newGuid(),
            'iface_id': this.fInterfaceData.inter_org.id,
          };
          for(let i=0;i<this.node_check_data.check_org.length;i++){
            let ccItem = {
              'id': elm.newGuid(),
              'check_id': cc.id,
              'iface_param_id': this.fInterfaceData.inter_org.param_id,
              'value': this.node_check_data.check_org[i],
            };
            node_check_param.push(ccItem);
          }
          node_check.push(cc);
        }
        if(this.node_check.check_role){
          let cc = {
            'id': elm.newGuid(),
            'iface_id': this.fInterfaceData.inter_role.id,
          };
          for(let i=0;i<this.node_check_data.check_role.length;i++){
            let ccItem = {
              'id': elm.newGuid(),
              'check_id': cc.id,
              'iface_param_id': this.fInterfaceData.inter_role.param_id,
              'value': this.node_check_data.check_role[i],
            };
            node_check_param.push(ccItem);
          }
          node_check.push(cc);
        }
        if(this.node_check.check_user){
          let cc = {
            'id': elm.newGuid(),
            'iface_id': this.fInterfaceData.inter_user.id,
          };
          for(let i=0;i<this.node_check_data.check_user.length;i++){
            let ccItem = {
              'id': elm.newGuid(),
              'check_id': cc.id,
              'iface_param_id': this.fInterfaceData.inter_user.param_id,
              'value': this.node_check_data.check_user[i],
              'uu_user_name':'--',
            };

            for(let kk=0;kk<this.node_check_data.check_user_show.length;kk++){
              if(this.node_check_data.check_user_show[kk].id == ccItem.value){
                ccItem.uu_user_name = this.node_check_data.check_user_show[kk].name;
              }
            }
            node_check_param.push(ccItem);
          }
          node_check.push(cc);
        }
        if(this.node_check.check_user_n){
          let cc = {
            'id': elm.newGuid(),
            'iface_id': this.fInterfaceData.inter_user.id,
          };
          let ccItem = {
            'id': elm.newGuid(),
            'check_id': cc.id,
            'iface_param_id': this.fInterfaceData.inter_user.param_id,
            'value': 'nothing',
          };
          node_check_param.push(ccItem);
          node_check.push(cc);
        }
        if(this.node_check.check_zjsj){
          let cc = {
            'id': elm.newGuid(),
            'iface_id': this.fInterfaceData.inter_zjsj.id,
          };
          let ccItem = {
            'id': elm.newGuid(),
            'check_id': cc.id,
            'iface_param_id': this.fInterfaceData.inter_zjsj.param_id,
            //'value': 'nothing',
          };
          node_check_param.push(ccItem);
          node_check.push(cc);

          person_name = person_name+'---'+'直接上级';
          person_num++;
        }
        if(this.node_check.check_flow_creater){
          let cc = {
            'id': elm.newGuid(),
            'iface_id': this.fInterfaceData.inter_flow_creater.id,
          };
          let ccItem = {
            'id': elm.newGuid(),
            'check_id': cc.id,
            'iface_param_id': this.fInterfaceData.inter_flow_creater.param_id,
            //'value': 'nothing',
          };
          node_check_param.push(ccItem);
          node_check.push(cc);

          person_name = person_name+'---'+'流程发起人';
          person_num++;
        }
        if(this.node_check.check_dynamic){
          let cc = {
            'id': elm.newGuid(),
            'iface_id': this.fInterfaceData.inter_dynamic.id,
          };
          let ccItem = {
            'id': elm.newGuid(),
            'check_id': cc.id,
            'iface_param_id': this.fInterfaceData.inter_dynamic.param_id,
            //'value': 'nothing',
          };
          node_check_param.push(ccItem);
          node_check.push(cc);

          person_name = person_name+'---'+'由上一节点指定';
          person_num++;
        }
      }

      //组装表单项配置数据
      let ff_item_list = [];
      for(let i=0;i<this.ff_item_list.length;i++){
        let item = {
          'column_name':this.ff_item_list[i].column_name,
          'ee_show':this.ff_item_list[i].ee_show,
          'ee_edit':this.ff_item_list[i].ee_show && this.ff_item_list[i].ee_edit,
        };
        ff_item_list.push(item);
      }

      //这里不更新数据表，只将修改后的数据传回
      let pData = {
        'node':this.model,
        'node_check':node_check,
        'node_check_param':node_check_param,
        'person_num':person_num,
        'person_name':person_name,
      };
      pData.node['ee_ff_item'] = JSON.stringify(ff_item_list);
      if(this.is_add=='yes'){
        pData['upper_node_id'] = this.upper_node_id;
        pData['add_node_type'] = this.add_node_type;
        this.DE_INFO.callVue.addNodeData(pData);
      }
      else{
        this.DE_INFO.callVue.refreshNodeData(pData);
      }

      this.v_cancle();
      this.loading = false;
    },

    addCheck:function(data){
      for(let i=0;i<data.check_org.length;i++){
        let item = data.check_org[i];
        if(!this.itemInList(item,this.node_check_data.check_org_show)){this.node_check_data.check_org_show.push(item);}
      }
      for(let i=0;i<data.check_role.length;i++){
        let item = data.check_role[i];
        if(!this.itemInList(item,this.node_check_data.check_role_show)){this.node_check_data.check_role_show.push(item);}
      }
      for(let i=0;i<data.check_user.length;i++){
        let item = data.check_user[i];
        if(!this.itemInList(item,this.node_check_data.check_user_show)){this.node_check_data.check_user_show.push(item);}
      }
      if(data.check_zjsj){ this.node_check.check_zjsj=true; }
      if(data.check_flow_creater){ this.node_check.check_flow_creater=true; }
      if(data.check_dynamic){ this.node_check.check_dynamic=true; }
        console.log(JSON.stringify(this.node_check_data.check_org_show));
    },
    deleteCheck:function(type,item_id){
      if(type=='check_org'){
        this.node_check_data.check_org_show = this.deleteItemFromList(item_id,this.node_check_data.check_org_show);
      }
      else if(type=='check_role'){
        this.node_check_data.check_role_show = this.deleteItemFromList(item_id,this.node_check_data.check_role_show);
      }
      else if(type=='check_user'){
        this.node_check_data.check_user_show = this.deleteItemFromList(item_id,this.node_check_data.check_user_show);
      }
      else if(type=='check_zjsj'){ this.node_check.check_zjsj=false; }
      else if(type=='check_flow_creater'){ this.node_check.check_flow_creater=false; }
      else if(type=='check_dynamic'){ this.node_check.check_dynamic=false; }
    },
    itemInList:function(item,tList){
      let found = false
      for(let i=0;i<tList.length;i++){ if(item.id == tList[i].id){found=true;} }
      return found;
    },
    deleteItemFromList:function(item_id,tList){
      let newList = [];
      for(let i=0;i<tList.length;i++){ if(item_id != tList[i].id){newList.push(tList[i]);} }
      return newList;
    },

    deleteNode:function (){
      this.DE_INFO.callVue.deleteNode(this.model.id);
      this.v_cancle();
    },

    orgSelected(){
      for(let i=0;i<this.node_check_for_select.org_list.length;i++){
        let item = this.node_check_for_select.org_list[i];
        if(item.id == this.node_check_data.check_org_temp){
          for(let kk=0;kk<this.node_check_data.check_org_show.length;kk++){
            if(this.node_check_data.check_org_show[kk].id == item.id){
              this.$message.error('已添加的部门'); return;
            }
          }

          this.node_check_data.check_org_show.push({'id':item.id,'name':item.org_name_path});
          this.node_check_data.check_org_temp = null;
        }
      }
    },
    roleSelected(){
      for(let i=0;i<this.node_check_for_select.role_list.length;i++){
        let item = this.node_check_for_select.role_list[i];
        if(item.id == this.node_check_data.check_role_temp){
          for(let kk=0;kk<this.node_check_data.check_role_show.length;kk++){
            if(this.node_check_data.check_role_show[kk].id == item.id){
              this.$message.error('已添加的角色'); return;
            }
          }

          this.node_check_data.check_role_show.push({'id':item.id,'name':item.name});
          this.node_check_data.check_role_temp = null;
        }
      }
    },
    userSelected(id,name){
      for(let kk=0;kk<this.node_check_data.check_user_show.length;kk++){
        if(this.node_check_data.check_user_show[kk].id == id){
          this.$message.error('已添加的用户'); return;
        }
      }

      this.node_check_data.check_user_show.push({'id':id,'name':name});
      this.node_check_data.check_user_temp = null;
      this.node_check_for_select.user_list = [];
    },

    v_cancle(){
      this.close();//extends: elmVueBase
    },

    em(s) {
      if (s == null || s == '') { return true; }
      else { return false; }
    },

  }
}
</script>
<style>
.f_edit .elm-body{padding: 5px;}
</style>